package com.bckj.fastboot.core.extra.stage;

import java.util.HashMap;
import java.util.Map;

@SuppressWarnings("unchecked")
public class StageRepository {

    private final Map<String, Stage<? extends BaseStageContext>> stageMap = new HashMap<>();
    public void add(Stage<? extends BaseStageContext> stage) {
        stageMap.put(stage.getStageId(), stage);
    }

    public <S> S get(String stageId) {
        return (S) stageMap.get(stageId);
    }
}
